/*
 * Copyright @ 苏州瑞云信息技术有限公司 All rights reserved.
 */
package cn.com.recloud.bbs.controller;


import cn.com.recloud.bbs.entity.bbs_article_type;
import cn.com.recloud.bbs.entity.bbs_my_article_type;
import cn.com.recloud.bbs.service.ArticleTypeService;
import cn.com.recloud.core.util.Result;
import cn.com.recloud.one.spring.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author keblea xie
 * @date 2020-06-08
 */
@RestController
@RequestMapping("/api/bbs/articletype")
@Api(tags = "pc端文章类型相关接口")
public class ArticleTypeController extends BaseController<bbs_article_type,ArticleTypeService> {

    @Resource
    ArticleTypeService articleTypeService;


    @GetMapping("findtypelist")
    @ApiOperation("查询文章分类")
    public Result findTypeList(String queryValue,
                               @RequestParam(required = false,defaultValue = "1") Integer pageIndex,
                               @RequestParam(required = false,defaultValue = "15") Integer pageSize){
        Map map = articleTypeService.findArticleTypeList(queryValue,pageIndex,pageSize);
        return new Result(map);
    }

    @PostMapping("allarticletype")
    @ApiOperation("App查询文章分类")
    public Result showArticleType(){
        List<bbs_my_article_type> list = articleTypeService.allArticleType();
        return new Result(list);
    }
}

